﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Globalization;

namespace AsNum.MySecret.Entity {
    public class Entity {
        public string Database {
            get;
            set;
        }
        public string Owner {
            get;
            set;
        }
        public string Name {
            get;
            set;
        }
        //public EntityType Type {
        //    get;
        //    set;
        //}
        public int ID {
            get;
            set;
        }
        public string Desc {
            get;
            set;
        }

        public IEnumerable<Column> Columns {
            get;
            set;
        }
    }

    public class Column {
        public string Database {
            get;
            set;
        }
        public string Owner {
            get;
            set;
        }
        public string Parent {
            get;
            set;
        }
        public int OrdinalPosition {
            get;
            set;
        }
        public string Name {
            get;
            set;
        }
        public string SysType {
            get;
            set;
        }
        public string DataType {
            get;
            set;
        }
        public string DefaultSetting {
            get;
            set;
        }
        public bool IsNullable {
            get;
            set;
        }
        public int MaxLength {
            get;
            set;
        }
        public int Precision {
            get;
            set;
        }
        public string Desc {
            get;
            set;
        }
    }

    public class Test {

        public Test() {
            List<Entity> entities = new List<Entity>();
            string str = Regex.Replace("", @"[^a-z\d]+(?<first>[a-z])?", (ma) => {
                return ma.Groups["first"].Value.ToUpper();
            });
        }

    }
}
